// Created by Joe on 2017/7/21.

app.service(
    'DrivingSchoolService',
    [
        'RequestProxyService',
        function (RequestProxyService) {
            return {
                getDrivingSchoolList: function (area, rate) {
                    return RequestProxyService.requestProxy('/localApp/getDriverSchoolInfo', {},
                        {areaCode: area, rate: rate},
                        function (resolve, info) {
                            resolve(info.result);
                        })();
                },
                getDrivingSchoolDetail: function (id, num) {
                    return RequestProxyService.requestProxy('/localApp/getDriverSchoolDetail', {},
                        {schoolId: id, n: -num},
                        function (resolve, info) {
                            resolve(info.result[0] || {});
                        })();
                }
            };
        }
    ]
);